﻿using UnityEngine;
using System.Collections;

public class TakePopupList : MonoBehaviour {
	private static TakePopupList instance;
	
	public static TakePopupList Instance{
		get{
			return instance;
		}
	}	
	
	void Awake()
	{
		instance = this;
	}

	UIPopupList popup;


	void InitPopup()
	{
		if(popup==null) {
			popup = GetComponent<UIPopupList>();
		}
	}

	public void SetIdle()
	{
		popup.value = ETake.idle01.ToString();
	}

	public void ClearList()
	{
		InitPopup();

		popup.Close();
		popup.items.Clear();
	}

	public void AddList(string _item)
	{
		InitPopup();
		popup.items.Add (_item);
	}

	public void OnChange()
	{
		Debug.Log("OnChange  "+popup.value);
		CharacterViewer.Instance.SetTake(popup.value);
		CharacterViewer.Instance.PlayTake();
	}

}
